{% extends "./base.html" %}
{% load comment_block %}

{% block title %}
    {{ post.title }}
{% endblock %}

{% block main %}
    {% block extra_head %}
    <link rel="stylesheet" href="https://cdn.bootcss.com/highlight.js/9.12.0/styles/googlecode.min.css">
    <script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
    <script>hljs.initHighlightingOnLoad();</script>
    {% endblock %}
    {% if post %}
    <h1>{{ post.title }}</h1>
    <div>
        <span>分类: <a href="{% url 'category-list' post.category_id%}">{{ post.category.name }}</a></span>
        <span>作者: <a href="#">{{ post.author }}</a></span>
        <span>创建时间: {{ post.created_time }}</span>
    </div>
    <hr/>
    <p>
        {% autoescape off %}
        {{ post.content_html }}
        {% endautoescape %}
    </p>
    {% endif %}

    {% comment_block request.path %}

{% endblock %}